#!/usr/bin/env python

from pprint import pprint

from veles.schema.nodeid import NodeID
from veles.scli import client
from veles.util import helpers


parser = helpers.get_client_argparse()
parser.add_argument(
    'id', help='hex-encoded id of parent object', nargs='?', default=None)
args = parser.parse_args()

client = client.create_client(args.server_url)

if args.id is not None:
    obj = NodeID.from_hex(args.id)
else:
    obj = NodeID.root_id

pprint(client.list(obj))
